def generate_magic_square(n):
    magic_square = [[0] * n for _ in range(n)]
    num = 1
    row, col = 0, n // 2
    magic_square[row][col] = num
    for num in range(2, n * n + 1):
        new_row, new_col = (row - 1) % n, (col + 1) % n
        if magic_square[new_row][new_col] != 0:
            row += 1
        else:
            row, col = new_row, new_col
        magic_square[row][col] = num
    return magic_square
def print_magic_square(magic_square):
    for row in magic_square:
        print(" ".join(map(str, row)))

n = int(input())

magic_square = generate_magic_square(n)
print_magic_square(magic_square)